package cn.edu.scau.dropship.ServiceImpl;

import cn.edu.scau.dropship.entity.Store;
import cn.edu.scau.dropship.entity.StoreExample;
import cn.edu.scau.dropship.mapper.StoreMapper;
import cn.edu.scau.dropship.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StoreServiceImpl implements StoreService {
    @Autowired
    private StoreMapper storeMapper;

    @Override
    public long countByExample(StoreExample example) {
        return storeMapper.countByExample(example);
    }

    @Override
    public int deleteByExample(StoreExample example) {
        return storeMapper.deleteByExample(example);
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return storeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Store record) {
        return storeMapper.insert(record);
    }

    @Override
    public int insertSelective(Store record) {
        return storeMapper.insertSelective(record);
    }

    @Override
    public List<Store> selectByExample(StoreExample example) {
        return storeMapper.selectByExample(example);
    }

    @Override
    public Store selectByPrimaryKey(Integer id) {
        return storeMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByExampleSelective(Store record, StoreExample example) {
        return storeMapper.updateByExampleSelective(record, example);
    }

    @Override
    public int updateByExample(Store record, StoreExample example) {
        return storeMapper.updateByExample(record, example);
    }

    @Override
    public int updateByPrimaryKeySelective(Store record) {
        return storeMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Store record) {
        return storeMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Store> selectByUid(Integer uid) {
        StoreExample storeExample=new StoreExample();
        StoreExample.Criteria criteria=storeExample.createCriteria();
        criteria.andBvoIdEqualTo(uid);
        List<Store> list=storeMapper.selectByExample(storeExample);
        return  list;
    }
}
